home *** CD-ROM | disk | FTP | other *** search
- function bombField(xPos, yPos, blastRadius)
- {
- var _loc2_ = new flash.geom.Matrix();
- _loc2_.translate(xPos,yPos);
- _root.hole_mc.holeResize._xscale = blastRadius;
- _root.hole_mc.holeResize._yscale = blastRadius;
- myBmp.draw(hole_mc,_loc2_,myCT,"erase");
- myHouseBmp.draw(hole_mc,_loc2_,myCT,"erase");
- }
- function cleanSweep(xStart)
- {
- var _loc1_ = 0;
- while(_loc1_ < 50)
- {
- xTest = xStart - majorX;
- yTest = 250 + _loc1_ * 5 + majorY;
- if(myBmp.getPixel(xTest,yTest) != 0)
- {
- if(myBmp.getPixel(xTest + 5,yTest) == 0 && myBmp.getPixel(xTest - 5,yTest) == 0)
- {
- if(myBmp.getPixel(xTest,yTest + 5) == 0 && myBmp.getPixel(xTest,yTest - 5) == 0)
- {
- bombField(xTest,yTest,20);
- }
- }
- }
- _loc1_ += 1;
- }
- }
- function cleanSweepVert(yStart)
- {
- var _loc1_ = 0;
- while(_loc1_ < 80)
- {
- xTest = _loc1_ * 5 + majorX;
- yTest = yStart - majorY;
- if(myBmp.getPixel(xTest,yTest) != 0)
- {
- if(myBmp.getPixel(xTest + 5,yTest) == 0 && myBmp.getPixel(xTest - 5,yTest) == 0)
- {
- if(myBmp.getPixel(xTest,yTest + 5) == 0 && myBmp.getPixel(xTest,yTest - 5) == 0)
- {
- bombField(xTest,yTest,20);
- }
- }
- }
- _loc1_ += 1;
- }
- }
- function speedRush()
- {
- ballBounce.play();
- if(Math.abs(xSpeed) > Math.abs(ySpeed))
- {
- ySpeed = maxSpeed / Math.abs(xSpeed) * ySpeed;
- xSpeed *= 50;
- }
- else
- {
- xSpeed = maxSpeed / Math.abs(ySpeed) * xSpeed;
- ySpeed *= 50;
- }
- }
- function bombDrop()
- {
- if(ballFreeze == false)
- {
- if(bombTimer <= 0)
- {
- bombTimer = bombTimegap;
- attachMovie("bombDrop","bombDrop" + bombID,750 + bombID);
- _root["bombDropMove" + bombID] = 0;
- _root["bombDropX" + bombID] = 200 - majorX;
- _root["bombDropY" + bombID] = 300 + majorY;
- _root["bombDrop" + bombID]._x = 200;
- _root["bombDrop" + bombID]._y = 300;
- _root["bombDrop" + bombID].exploded = false;
- bombID += 1;
- if(bombID >= 20)
- {
- bombID = 1;
- }
- }
- }
- }
- function makeMap()
- {
- attachMovie("map1","map1",110);
- map1.gotoAndStop(_root.currentLevel);
- myBmp.draw("map1",myMatrix,myCT,"layer");
- removeMovieClip("map1");
- }
- function makeHouseMap()
- {
- attachMovie("map2","map2",105);
- map2.gotoAndStop(_root.currentLevel);
- myHouseBmp.draw("map2",myMatrix,myCT,"layer");
- removeMovieClip("map2");
- }
- function removeLine()
- {
- removeMovieClip(drawLine);
- removeMovieClip(starSpin1);
- removeMovieClip(starSpin2);
- removeMovieClip(mapHolder.starSpin1);
- removeMovieClip(mapHolder.starSpin2);
- removeMovieClip(mapHolder.drawLine);
- }
- _quality = _root.game_quality;
- if(sound_on == true)
- {
- bgSound = new Sound(this);
- bgSound.attachSound("track_" + currentLevel);
- bgSound.start(0,99);
- }
- attachMovie("barSide","barLeft",151);
- attachMovie("barSide","barRight",152);
- attachMovie("barTop","barTop",153);
- attachMovie("barTop","barBase",154);
- attachMovie("background1","background1",1);
- attachMovie("background2","background2",2);
- attachMovie("background3","background3",3);
- attachMovie("ballBounce","ballBounce",300);
- ballBounce._x = 200;
- ballBounce._y = 275;
- attachMovie("topMask","topMask",900);
- topMask._x = 0;
- topMask._y = 0;
- topMask.mapDisplay.attachMovie("ballSymbol","ballSymbol",2000);
- bitNumber = 20;
- bitCount = 0;
- var i = 1;
- while(i <= bitNumber)
- {
- attachMovie("bit","bit" + i,600 + i);
- bitCount += 1;
- topMask.mapDisplay.attachMovie("bitMarker","bitMarker" + i,1950 + i);
- _root["bit" + i].id = i;
- _root["bitStartX" + i] = Math.random() * 1800 + 100;
- _root["bitStartY" + i] = Math.random() * 600 + 100;
- _root["bitSpeedX" + i] = -2;
- _root["bitAlive" + i] = true;
- _root["bitDirectionX" + i] = 2 * Math.round(Math.random()) - 1;
- _root["bitMoveX" + i] = 0;
- _root["bitMoveY" + i] = 0;
- i++;
- }
- var myMatrix = new flash.geom.Matrix();
- var myCT = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
- var myBmp = new flash.display.BitmapData(2500,1000,true,0);
- var myHouseBmp = new flash.display.BitmapData(2500,1000,true,0);
- createEmptyMovieClip("mapHolder",709);
- mapHolder.attachBitmap(myBmp,10,"never",false);
- topMask.mapDisplay.displayMapHolder.attachBitmap(myBmp,11,"never",false);
- myMatrix.translate(0,120);
- attachMovie("hole","hole_mc",450);
- hole_mc._visible = false;
- attachMovie("bloodMark","bloodMark",451);
- bloodMark._visible = false;
- makeMap();
- mapHolder.attachBitmap(myHouseBmp,8,"never",false);
- topMask.mapDisplay.displayMapHolder.attachBitmap(myHouseBmp,9,"never",false);
- makeHouseMap();
- array = new Array(360);
- ballRadius = ballBounce.innerBall._width / 2;
- startDraw = false;
- lineStartPointX = 0;
- lineStartPoint = 0;
- lineEndPointX = 0;
- lineEndPointY = 0;
- majorX = -800;
- majorY = -200;
- xSpeed = 0;
- ySpeed = 10;
- bombID = 1;
- bombTimer = 0;
- powerUpTimer = 0;
- fireSpin = false;
- laser = false;
- laserShoot = false;
- laserDir = 1;
- abilityTimer = 0;
- powerUpState = false;
- poweredUp = false;
- chainCrush = 1;
- chainLink = 0;
- chainLinkMax = 100;
- ballFreeze = false;
- spaceDown = false;
- ballFreeze = true;
- bitValue = 90 + currentLevel * 10;
- scoreDecreaseTimer = 0;
- totalScore = 1000;
- abilityTimerMax = 500;
- powerUpTimerMax = 700;
- maxSpeed = 12;
- gravity = 0.4;
- speedNudge = 0.8;
- bombPower = 60;
- bombTimegap = 20;
- var mouseListener = new Object();
- mouseListener.onMouseWheel = function(delta)
- {
- bombDrop();
- };
- topMask.bombGauge.bombSymbol.onPress = function()
- {
- bombDrop();
- };
- topMask.menuButton.onRollOver = function()
- {
- this._xscale = 120;
- this._yscale = 120;
- };
- topMask.menuButton.onRollOut = function()
- {
- this._xscale = 100;
- this._yscale = 100;
- };
- topMask.menuButton.onPress = function()
- {
- _root.gotoAndStop("menuScreen");
- };
- topMask.music_toggle.onRollOver = function()
- {
- this._xscale = 120;
- this._yscale = 120;
- };
- topMask.music_toggle.onRollOut = function()
- {
- this._xscale = 100;
- this._yscale = 100;
- };
- topMask.music_toggle.onPress = function()
- {
- if(sound_on == true)
- {
- sound_on = false;
- bgSound.stop();
- }
- else
- {
- sound_on = true;
- bgSound = new Sound(this);
- bgSound.attachSound("track_" + _root.currentLevel);
- bgSound.start(0,99);
- }
- };
- topMask.music_toggle.onEnterFrame = function()
- {
- if(sound_on == true)
- {
- this.gotoAndStop(2);
- }
- else
- {
- this.gotoAndStop(1);
- }
- };
- Mouse.addListener(mouseListener);
- onMouseDown = function()
- {
- if(ballFreeze == false)
- {
- if(_ymouse > 150)
- {
- if(ballBounce.innerBall.hitTest(_xmouse,_ymouse,true))
- {
- speedRush();
- }
- else
- {
- removeLine();
- attachMovie("attachLine","attachLine",850);
- }
- }
- }
- };
- onMouseUp = function()
- {
- if(startDraw == true)
- {
- startDraw = false;
- drawAllowed = true;
- mapHolder.attachMovie("attachLine","drawLine",850);
- mapHolder.drawLine._alpha = 100;
- mapHolder.drawLine._x = attachLine._x - majorX;
- mapHolder.drawLine._y = attachLine._y + majorY;
- mapHolder.drawLine._rotation = drawAngle;
- bounceAngle = drawAngle;
- removeMovieClip(attachLine);
- lineAngle = mapHolder.drawLine._rotation;
- }
- else if(!ballBounce.innerBall.hitTest(_xmouse,_ymouse,true))
- {
- removeLine();
- }
- else
- {
- removeMovieClip(attachLine);
- }
- };
- _root.onEnterFrame = function()
- {
- _quality = _root.game_quality;
- if(Key.isDown(32))
- {
- if(spaceDown == false)
- {
- spaceDown = true;
- bombDrop();
- }
- }
- else
- {
- spaceDown = false;
- }
- removeMovieClip(mapHolder.starSpinFade1);
- removeMovieClip(mapHolder.starSpinFade2);
- mapHolder.drawLine2.clear();
- baseCollision = false;
- topCollision = false;
- leftCollision = false;
- rightCollision = false;
- drawCollision = 1;
- ballLineCollision = false;
- if(xSpeed * ySpeed < 0)
- {
- minLoop = 360;
- maxLoop = 0;
- inc = -10;
- }
- else
- {
- minLoop = 0;
- maxLoop = 360;
- inc = 10;
- }
- lineCollision = false;
- i = minLoop;
- while(i != maxLoop)
- {
- xPos = ballBounce._x + ballRadius * Math.cos(i / 180 * 3.141592653589793);
- yPos = ballBounce._y - ballRadius * Math.sin(i / 180 * 3.141592653589793);
- if(_root.barLeft.hitTest(xPos,yPos,true))
- {
- leftCollision = true;
- chainLink -= 1;
- }
- if(_root.barRight.hitTest(xPos,yPos,true))
- {
- rightCollision = true;
- chainLink -= 1;
- }
- if(_root.barBase.hitTest(xPos,yPos,true))
- {
- baseCollision = true;
- chainLink -= 1;
- }
- if(_root.barTop.hitTest(xPos,yPos,true))
- {
- topCollision = true;
- }
- if(_root.drawLine.hitTest(xPos,yPos,true))
- {
- ballLineCollision = true;
- }
- if(_root.mapHolder.drawLine.hitTest(xPos,yPos,true))
- {
- Array[i] = 1;
- lineCollision = true;
- }
- else if(myBmp.getPixel(xPos - majorX,yPos + majorY) != 0)
- {
- Array[i] = 1;
- }
- else if(myHouseBmp.getPixel(xPos - majorX,yPos + majorY) != 0)
- {
- Array[i] = 1;
- }
- else
- {
- Array[i] = 0;
- }
- i += inc;
- }
- startNode = 0;
- endNode = 0;
- i = minLoop;
- while(i != maxLoop)
- {
- if(lastCheck > 0 && Array[i] > 0)
- {
- startNode = i;
- }
- if(lastCheck > 0 && Array[i] == 0)
- {
- endNode = i;
- }
- lastCheck = Array[i];
- i += inc;
- }
- if(endNode - startNode > 180 || endNode - startNode < -180)
- {
- angle = 0;
- }
- else
- {
- angle = (startNode + endNode) / 2;
- }
- speed = Math.sqrt(xSpeed * xSpeed + ySpeed * ySpeed);
- currentAngle = Math.atan(ySpeed / xSpeed) / 0.017453292519943295;
- if(xSpeed > 0)
- {
- currentAngle += 180;
- }
- if(startNode != endNode)
- {
- if(lineCollision == true)
- {
- if(drawAllowed == true)
- {
- drawAllowed = false;
- xSpeed = maxSpeed * Math.sin((bounceAngle + 90) / 180 * 3.141592653589793);
- ySpeed = maxSpeed * Math.cos((bounceAngle + 90) / 180 * 3.141592653589793);
- }
- }
- else
- {
- xSpeed = speed * Math.sin((angle + 90) / 180 * 3.141592653589793);
- ySpeed = (- speed) * Math.cos((angle + 90) / 180 * 3.141592653589793);
- }
- }
- else
- {
- ySpeed += gravity;
- }
- if(startDraw == true)
- {
- lineEndPointX = _xmouse;
- lineEndPointY = _ymouse;
- drawLine.clear();
- drawLine.lineStyle(8,0,100);
- drawLine.moveTo(lineStartPointX,lineStartPointY);
- drawLine.lineTo(lineEndPointX,lineEndPointY);
- }
- if(xSpeed > maxSpeed)
- {
- xSpeed = maxSpeed;
- }
- if(xSpeed < - maxSpeed)
- {
- xSpeed = - maxSpeed;
- }
- if(ySpeed > maxSpeed)
- {
- ySpeed = maxSpeed;
- }
- if(ySpeed < - maxSpeed)
- {
- ySpeed = - maxSpeed;
- }
- if(baseCollision == true)
- {
- ySpeed = -7;
- }
- if(topCollision == true)
- {
- ySpeed = 7;
- }
- if(leftCollision == true)
- {
- xSpeed = -7;
- }
- if(rightCollision == true)
- {
- xSpeed = 7;
- }
- if(ballFreeze == false)
- {
- majorX += xSpeed * speedNudge;
- majorY += ySpeed * speedNudge;
- }
- if(myBmp.getPixel(ballBounce._x - majorX,ballBounce._y + majorY) != 0)
- {
- bombField(ballBounce._x - majorX,ballBounce._y + majorY,50);
- }
- background1._x = 0 + majorX / 16;
- background1._y = 152;
- background2._x = -100 + majorX / 4;
- background2._y = 80 - majorY / 4;
- background3._x = -200 + majorX / 1.3;
- background3._y = -50 - majorY / 1.3;
- mapHolder._x = 0 + majorX;
- mapHolder._y = - majorY;
- barTop._x = 0 + majorX;
- barTop._y = - majorY;
- barBase._x = 0 + majorX;
- barBase._y = 1000 - majorY;
- barLeft._x = 0 + majorX;
- barLeft._y = - majorY;
- barRight._x = 1990 + majorX;
- barRight._y = - majorY;
- powerUp._x = powerUpX + majorX;
- powerUp._y = powerUpY - majorY;
- var i = 1;
- while(i <= 30)
- {
- if(myHouseBmp.getPixel(_root["bit" + i]._x - majorX,_root["bit" + i]._y - 20 + majorY) != 0)
- {
- if(myHouseBmp.getPixel(_root["bit" + i]._x - 25 - majorX,_root["bit" + i]._y - 20 + majorY) == 0)
- {
- _root["bitDirectionX" + i] = -1;
- }
- if(myHouseBmp.getPixel(_root["bit" + i]._x + 25 - majorX,_root["bit" + i]._y - 20 + majorY) == 0)
- {
- _root["bitDirectionX" + i] = 1;
- }
- }
- else if(ballFreeze == false)
- {
- if(_root["bit" + i].hitTest(ballBounce.hitZone) && _root["bitAlive" + i] == true)
- {
- _root["bitAlive" + i] = false;
- _root["bit" + i].gotoAndPlay("death");
- }
- if(laserShoot == true)
- {
- if(_root["bit" + i].hitTest(laserShot))
- {
- _root["bitAlive" + i] = false;
- _root["bit" + i].gotoAndPlay("death");
- laserShot.removeMovieClip();
- laserShoot = false;
- }
- }
- else if(laser == true)
- {
- if(_root["bit" + i].hitTest(ballBounce.laserLineR))
- {
- laserShoot = true;
- attachMovie("laserShot","laserShot",780);
- laserDir = 1;
- laserShot._x = ballBounce._x + 35;
- laserShot._y = ballBounce._y;
- }
- if(_root["bit" + i].hitTest(ballBounce.laserLineL))
- {
- laserShoot = true;
- attachMovie("laserShot","laserShot",780);
- laserDir = -1;
- laserShot._x = ballBounce._x - 35;
- laserShot._y = ballBounce._y;
- }
- }
- }
- if(_root["bit" + i]._y + majorY < 900)
- {
- if(myBmp.getPixel(_root["bit" + i]._x - 5 - majorX,_root["bit" + i]._y - 25 + majorY) != 0)
- {
- _root["bitDirectionX" + i] = 1;
- }
- if(myBmp.getPixel(_root["bit" + i]._x + 5 - majorX,_root["bit" + i]._y - 25 + majorY) != 0)
- {
- _root["bitDirectionX" + i] = -1;
- }
- if(myBmp.getPixel(_root["bit" + i]._x - 5 - majorX,_root["bit" + i]._y + 20 + majorY) == 0)
- {
- _root["bitDirectionX" + i] = -1;
- }
- if(myBmp.getPixel(_root["bit" + i]._x + 5 - majorX,_root["bit" + i]._y + 20 + majorY) == 0)
- {
- _root["bitDirectionX" + i] = 1;
- }
- }
- if(_root["bit" + i].hitTest(barLeft))
- {
- _root["bitDirectionX" + i] = -1;
- }
- if(_root["bit" + i].hitTest(barRight))
- {
- _root["bitDirectionX" + i] = 1;
- }
- _root["bit" + i]._xscale = _root["bitDirectionX" + i] * 100;
- _root["bitMoveX" + i] += _root["bitDirectionX" + i] * _root["bitSpeedX" + i];
- var _loc3_ = {x:_root["bit" + i].dirtPoint._x,y:_root["bit" + i].dirtPoint._y};
- _root["bit" + i].dirtPoint.localToGlobal(_loc3_);
- _root["bit" + i]._x = _root["bitStartX" + i] + majorX + _root["bitMoveX" + i];
- _root["bit" + i]._y = _root["bitStartY" + i] - majorY + _root["bitMoveY" + i];
- if(myBmp.getPixel(_root["bit" + i]._x - majorX,_loc3_.y + majorY) == 0 && myBmp.getPixel(_root["bit" + i]._x - majorX,_root["bit" + i]._y - 0 + majorY) == 0)
- {
- if(_root["bit" + i]._y >= barBase._y)
- {
- _root["bit" + i]._y = barBase._y;
- }
- else
- {
- _root["bitMoveY" + i] += 5;
- }
- }
- else if(myBmp.getPixel(_root["bit" + i]._x - majorX,_loc3_.y + majorY) != 0)
- {
- _root["bitMoveY" + i] -= 5;
- }
- var _loc4_ = {x:_root["bit" + i].basePointLeft._x,y:_root["bit" + i].basePointLeft._y};
- _root["bit" + i].basePointLeft.localToGlobal(_loc4_);
- var _loc2_ = {x:_root["bit" + i].basePointRight._x,y:_root["bit" + i].basePointRight._y};
- _root["bit" + i].basePointRight.localToGlobal(_loc2_);
- if(myBmp.getPixel(_loc4_.x - majorX,_loc4_.y + majorY) == 0)
- {
- if(myBmp.getPixel(_loc2_.x - majorX,_loc2_.y + majorY) == 0)
- {
- _root["bit" + i]._rotation = 0;
- }
- else
- {
- _root["bit" + i]._rotation -= 5 * _root["bitDirectionX" + i];
- }
- }
- else if(myBmp.getPixel(_loc2_.x - majorX,_loc2_.y + majorY) == 0)
- {
- _root["bit" + i]._rotation += 5 * _root["bitDirectionX" + i];
- }
- i++;
- }
- topMask.mapDisplay.ballSymbol._x = majorX / -10 + 20;
- topMask.mapDisplay.ballSymbol._y = majorY / 10 + 27;
- var i = 1;
- while(i <= 30)
- {
- topMask.mapDisplay["bitMarker" + i]._x = (_root["bitStartX" + i] + _root["bitMoveX" + i]) / 10;
- topMask.mapDisplay["bitMarker" + i]._y = (_root["bitStartY" + i] + _root["bitMoveY" + i]) / 10;
- i++;
- }
- cleanSweep(0);
- cleanSweep(-5);
- cleanSweep(400);
- cleanSweep(405);
- cleanSweepVert(250);
- cleanSweepVert(245);
- cleanSweepVert(500);
- cleanSweepVert(505);
- xDistance = 200 - majorX;
- do
- {
- if(xDistance > 300)
- {
- xDistance -= 300;
- }
- }
- while(xDistance > 300);
-
- ballFrame = Math.ceil(xDistance / 10);
- ballBounce.innerBall.gotoAndStop(ballFrame);
- var i = 1;
- while(i < 20)
- {
- _root["bombDrop" + i]._x = _root["bombDropX" + i] + majorX;
- _root["bombDrop" + i]._y = _root["bombDropY" + i] - majorY + _root["bombDropMove" + i];
- bombDropX = _root["bombDrop" + i]._x - majorX;
- bombDropY = _root["bombDrop" + i]._y + majorY;
- if(myBmp.getPixel(bombDropX,bombDropY) != 0 || myHouseBmp.getPixel(bombDropX,bombDropY) != 0)
- {
- blastArea = bombPower;
- bombField(bombDropX,bombDropY,blastArea);
- _root["bombDrop" + i].play();
- }
- else if(_root["bombDrop" + i].hitTest(_root.barBase))
- {
- _root["bombDrop" + i].play();
- }
- else if(_root["bombDrop" + i].exploded == false)
- {
- _root["bombDropMove" + i] += 5;
- }
- i++;
- }
- if(bombTimer > 0)
- {
- bombTimer -= 1;
- }
- displayX = xSpeed;
- displayY = ySpeed;
- if(drawAllowed == false)
- {
- mapHolder.drawLine.gotoAndStop(2);
- mapHolder.drawLine._alpha -= 20;
- }
- xStart = _xmouse;
- yStart = _ymouse;
- attachLine._x = xStart;
- attachLine._y = yStart;
- lineX = xStart - 200;
- lineY = yStart - 275;
- lineDistance = Math.sqrt(lineX * lineX + lineY * lineY);
- if(lineDistance < 15)
- {
- attachLine._alpha = 0;
- startDraw = false;
- }
- else
- {
- attachLine._alpha = 50;
- startDraw = true;
- }
- drawAngle = Math.atan((xStart - 200) / (yStart - 275)) / 0.017453292519943295;
- if(yStart >= 275)
- {
- drawAngle = 90 - drawAngle;
- }
- else
- {
- drawAngle = 270 - drawAngle;
- }
- if(xStart > 200 && (drawAngle < 190 && drawAngle > 170))
- {
- drawAngle = 0;
- }
- if(xStart < 200 && (drawAngle < 10 || drawAngle > 350))
- {
- drawAngle = 180;
- }
- attachLine._rotation = drawAngle;
- tracevar = xStart + " " + drawAngle;
- if(fireSpin == true || laser == true)
- {
- poweredUp = true;
- }
- else
- {
- poweredUp = false;
- }
- powerUpX += 3;
- if(powerUpX >= 2000)
- {
- powerUpX = 0;
- powerUpY = Math.random() * 900 + 50;
- }
- topMask.mapDisplay.powerUpMarker._x = powerUpX / 10;
- topMask.mapDisplay.powerUpMarker._y = powerUpY / 10;
- if(poweredUp == false && powerUpState == false)
- {
- powerUpX = Math.random() * 2000;
- powerUpY = Math.random() * 900 + 50;
- if(myBmp.getPixel(powerUpX,powerUpY) == 0)
- {
- attachMovie("powerUp","powerUp",750);
- powerUpChoose = Math.random() * 100;
- if(powerUpChoose > 75)
- {
- powerUpType = "blastRadius";
- }
- else if(powerUpChoose > 50)
- {
- powerUpType = "bombFreq";
- }
- else if(powerUpChoose > 25)
- {
- powerUpType = "laser";
- }
- else if(powerUpChoose > 0)
- {
- powerUpType = "fireSpin";
- }
- powerUp.symbol.gotoAndStop(powerUpType);
- powerUpState = true;
- topMask.mapDisplay.attachMovie("powerUpMarker","powerUpMarker",2050);
- }
- }
- if(ballBounce.innerBall.hitTest(powerUp))
- {
- if(powerUpState == true)
- {
- powerUpState = false;
- powerUp.gotoAndPlay("removePowerUp");
- if(powerUpType == "blastRadius")
- {
- topMask.powerUpDisplay.gotoAndPlay("blastRadius");
- bombPower += 20;
- }
- else if(powerUpType == "bombFreq")
- {
- topMask.powerUpDisplay.gotoAndPlay("bombFreq");
- if(bombTimegap > 5)
- {
- bombTimegap -= 5;
- }
- else
- {
- bombTimegap = 5;
- }
- }
- else if(powerUpType == "laser")
- {
- topMask.powerUpDisplay.gotoAndStop("laser");
- laser = true;
- fireSpin = false;
- abilityTimer = abilityTimerMax;
- }
- else if(powerUpType == "fireSpin")
- {
- topMask.powerUpDisplay.gotoAndStop("fireSpin");
- fireSpin = true;
- laser = false;
- abilityTimer = abilityTimerMax;
- }
- }
- }
- if(fireSpin == true)
- {
- ballBounce.hitZone._xscale = 150;
- ballBounce.hitZone._yscale = 180;
- ballBounce.fireSpin._alpha = 100;
- }
- else
- {
- ballBounce.hitZone._xscale = 55;
- ballBounce.hitZone._yscale = 70;
- ballBounce.fireSpin._alpha = 0;
- }
- if(laser == true)
- {
- ballBounce.laser._alpha = 50;
- }
- else
- {
- ballBounce.laser._alpha = 0;
- }
- if(laserShoot == true)
- {
- laserShot._x += 20 * laserDir;
- if(myHouseBmp.getPixel(laserShot._x - majorX,laserShot._y + majorY) != 0 || laserShot._x < -50 || laserShot._x > 450)
- {
- laserShot.removeMovieClip();
- laserShoot = false;
- }
- }
- if(poweredUp == true)
- {
- abilityTimer -= 1;
- if(abilityTimer == 0)
- {
- topMask.powerUpDisplay.gotoAndStop("none");
- topMask.timeBar._alpha = 0;
- fireSpin = false;
- laser = false;
- }
- else
- {
- topMask.timeBar._alpha = 100;
- topMask.timeBar.powerMask._xscale = abilityTimer / abilityTimerMax * 100;
- }
- }
- topMask.chainDisplay.gotoAndStop(chainCrush);
- if(chainLink > 0)
- {
- chainLink -= 1;
- topMask.chainTimeBar._alpha = 100;
- topMask.chainTimeBar.powerMask._xscale = chainLink / chainLinkMax * 100;
- }
- else
- {
- topMask.chainTimeBar._alpha = 0;
- chainCrush = 1;
- }
- if(bitCount == 0)
- {
- if(ballFreeze == false)
- {
- ballBounce.gotoAndPlay("explode");
- topMask.finishDisplay.play();
- }
- removeLine();
- ballFreeze = true;
- }
- else
- {
- scoreDecreaseTimer += 1;
- if(scoreDecreaseTimer == 30)
- {
- scoreDecreaseTimer = 0;
- totalScore -= 10;
- }
- }
- };
-